
<template>
	<view class="">
		<view class="cu-bar tabbar bg-white shadow foot">
			<block v-for="(item, index) in tabList" :key="index">
				<view class="action" @tap="switchTab(item, index)">
					<view class='cuIcon-cu-image'>
						<!-- <image :src="'/static/tabbar/basics' + [PageCur=='basics'?'_cur':''] + '.png'"></image> -->
					</view>
					<view :class="current == index ? 'text-green':'text-gray'">{{item.text}}</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				tabList: [{
					text: '首页',
					url: '/pages/home/index',
				}, {
					text: 'demo',
					url: '/pages/demo/index'
				}]
			}
		},
		props: {
			current: { type: [Number, String], default: 0 },
			backgroundColor: { type: String, default: '#fbfbfb' },
			color: { type: String, default: '#999' },
		},
		methods: {
			switchTab(item) {
				uni.redirectTo({
					url: item.url
				})
			}
		}
	}
</script>

<style>
</style>
